<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<link rel="stylesheet" href="./jisuanqi3.css">
	<title>计算器4</title>
</head>
<body>
	<div id="calculator"> 
	<div id="calcu-head"><span class="imyeah"> <a href="http://www.daniuit.com" target="_blank">我是杨春辉!</a></span><h6>简单的计算器</h6>
	</div> 
	<form name="calculator" action="jisuanqi3.php" method="post" > 
		<input type="text" value="请输入第一个数" name="num1" onclick="this.value='';focus()"><br /> 
		选择计算符号:<select name="oper"> 
		<option value="+">+</option> 
		<option value="-">-</option> 
		<option value="*">*</option> 
		<option value="/">/</option> 
		</select>
		<br /> 
		<input type="text" value="请输入第二个数" name="num2" onclick="this.value='';focus()"><br /> 
		<input type="submit" value="计算"><br /> 
	<?php 
		$num1=$_POST['num1']; 
		$num2=$_POST['num2']; 
		$oper=$_POST['oper']; 
		$rs=0; 
		switch($oper){ 
		case "+": 
		$rs=$num1+$num2; 
		break; 
		case "-": 
		$rs=$num1-$num2; 
		break; 
		case "*": 
		$rs=$num1*$num2; 
		break; 
		case "/": 
		$rs=$num1/$num2; 
		break; 
		default: echo "您输入的不正确"; 
		} 
		$_SESSION['rs']=$rs; 
		 echo '计算结果为：'.$_SESSION['rs']; 
	?> 
	<br>

	<span class="welcome">欢迎使用PHP计算器！<a href="tencent://message/?uin=463951452" target="_blank">反馈</a></span> 
	</form> 
	</div> 
</body>
</html>